package singleton

import "fmt"

var (
	userMap map[int]int
)

func GetUserIdMapping(u int, info string) int {
	if u == 0 {
		return 0
	}

	r := userMap[u]
	if r == 0 {
		panic(fmt.Sprintf("no user mapping %d,info: %s", u, info))
	}
	return r
}

func InitUserMapping(a map[int]int) {
	userMap = a
}
